-
-
Notifications
You must be signed in to change notification settings - Fork 133
fix: bundled-source.js - transformed source map is saved to cache.
#1216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
3cp
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Just one small suggestion.
lib/build/bundled-source.js
Outdated
| return this._transformedSourceMap === null | ||
| ? this.file.sourceMap | ||
| : this._transformedSourceMap; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can just do return this._transformedSourceMap || this.file.sourceMap;.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I adopted the suggested change and I also added check when caching - if property _transformedSourceMap is null, cache value is set to undefined, so it's skipped in JSON.stringify. No need to cache null values.
|
@bigpon another patch release pls. |
|
3.0.7 has been released, thanks @nenadvicentic @3cp 🙏 |
…r is outside of project's root folder (aurelia#1213) + fix: `bundled-source.js` - transformed source map is saved to cache. (aurelia#1216)
Previous pull request #1215 did not take in consideration
BundledSourcecache, so we would get correct source map only on firstau build. Secondau build, without source file change, when cache is used, CLI would fallback to originalfile.sourceMap, because transformed source map was not cached.Issue is now fixed:
_transformedSourceMapproperty, to differentiate fromfile.sourceMap._transformedSourceMapsaved/read from cache.bundled-source.spec.js. They are variation on 2 existing cache tests.build.options.cacheon and off.